import datetime
start = datetime.date(2000, 1, 1)
end = datetime.date(2024, 4, 13)
gap = datetime.timedelta(days = 1)
x = [13, 1, 2, 3, 5, 4, 4, 2, 2, 2]
ans = 0

while start <= end:
    date = map(int, list(str(start).replace('-', '')))
    cnt = 0
    for i in date:
        cnt += x[i]
    if cnt > 50:
        ans += 1
    start += gap

print(ans)